package com.itheima.stringbuilder;

import java.util.Scanner;

/*
判断字符串是否对称
 */
public class StringBuilderDemo3 {
    public static void main(String[] args) {
        //键盘录入字符串,使用Scanner实现
        Scanner sc = new Scanner(System.in);
        //用户提示
        System.out.println("请输入:");
        String str = sc.next();
        method(str);
    }

    private static void method(String str) {

        StringBuilder sb = new StringBuilder(str);
        StringBuilder sbr = sb.reverse();
        String sb1 = sbr.toString();
        if (str.equals(sb1)){
            System.out.println("是对称字符串");
        }
    }
}
